

METHODDEF(void)
my_error_exit (j_common_ptr cinfo)
{
	/* cinfo->err really points to a my_error_mgr struct, so coerce pointer */
	//my_error_ptr myerr = (my_error_ptr) cinfo->err;

	/* Always display the message. */
	/* We could postpone this until after returning, if we chose. */
	(cinfo->err->output_message) (cinfo);
	//  char * msg = *cinfo->err->jpeg_message_table[cinfo->err->msg_code];
	/* Return control to the setjmp point */
	//  longjmp(myerr->setjmp_buffer, 1);

	/*
	QFile * qFile = new QFile();
	QString fileName("xrayLogErrors.txt");		
	qFile->setFileName(fileName); 		
	qFile->open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append);
	QTextStream out(qFile);			
	//char * msg = * ;
	//if(level < 0)
	//out <<"jpegError - "<< cinfo->err->jpeg_message_table[cinfo->err->msg_code]<<" \\ level = " << "noLevel" <<"\\"<<QDateTime::currentDateTime().toString() <<"\\"<< filePath<<"\\\n" ;
	qFile->close();		
	*/
}

static long jpeg_emit_message(j_common_ptr cinfo, int level){
	return 0;
	QFile * qFile = new QFile();
	QString fileName("xrayLogErrors.txt");		
	qFile->setFileName(fileName); 		
	qFile->open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append);
	QTextStream out(qFile);			
	//char * msg = * ;
	//if(level < 0)
	//out <<"jpegError - "<< cinfo->err->jpeg_message_table[cinfo->err->msg_code]<<" \\ level = " <<level <<"\\"<<QDateTime::currentDateTime().toString() <<"\\"<< filePath<<"\\\n" ;
	qFile->close();		
	return 0;
}

//#ifdef __DECODE_JPEG_COMPRESSION__
static void JpegInitSource( j_decompress_ptr dinfo )
{
}

static boolean JpegFillInputBuffer( j_decompress_ptr dinfo )
{
	return TRUE;
}

static void JpegSkipInputData( j_decompress_ptr dinfo, long num_bytes )
{
	jpeg_source_mgr &jpegSrcManager = *( dinfo->src );
	jpegSrcManager.next_input_byte += (size_t) num_bytes;
	jpegSrcManager.bytes_in_buffer -= (size_t) num_bytes;
}

static void JpegTermSource( j_decompress_ptr dinfo )
{
	/* No work necessary here. */
}
//#endif